getTextWithEllipses

Calculate text to fit within a box. In case the text is too long to fit in the box, ellipsis characters will be added.

getTextWithEllipsis(textProperties: IFontStyle, text: string, maxWidth: number): string

Arguments

textProperties: IFontStyle

  • The text properties for which to calculate the width.

text: string

  • The text for which to calculate the width.

maxWidth: number

  • The maximum available width for the text.

Returns

string

  • The original text, with ellipsis characters if necessary.